from ft_table import *        
ft_table = FtTable('osu.map@gmail.com', 'dlzosumap', 422606)

print 'testing all'


ft_table.order('ID').filter("CREATED_BY = 'ymeng@dlz.com'")

print ft_table.count()
for r in ft_table.fetch(None, None, ['rowid', 'CREATED_BY', 'ID']):
    print r['CREATED_BY'], r['ID'], r['rowid']
    
print len(ft_table.fetch(10, 10))
print ft_table.get(3610)

#print 'insert new ones'
#records = []
#for i in range(20):
#    records.append({'ID': 'dlz-%s' % i})
#
#record = {'ID': 'dlz1'}
#print ft_table.insert(record)
#
#print ft_table.batch_insert(records)

ft_table.filter("ID starts with 'dlz'")
dlz_ones = ft_table.fetch(None, None, ['rowid'])

print ft_table.count()
import time
for rowid in dlz_ones:
    
    print ft_table.delete(rowid['rowid'])
